.class public Lcom/nemustech/tiffany/world/TFWorld$TFBackground;
.super Lcom/nemustech/tiffany/world/TFModel;
.source "TFWorld.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/nemustech/tiffany/world/TFWorld;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x1
    name = "TFBackground"
.end annotation


# static fields
.field private static final TAG:Ljava/lang/String; = "TFBackground"


# instance fields
.field protected mChanged:Z

.field private mRealized:Z

.field protected mZ:F

.field final synthetic this$0:Lcom/nemustech/tiffany/world/TFWorld;


# direct methods
.method public constructor <init>(Lcom/nemustech/tiffany/world/TFWorld;Lcom/nemustech/tiffany/world/TFWorld;)V
    .locals 2
    .parameter
    .parameter "world"

    .prologue
    const/4 v1, 0x0

    .line 831
    iput-object p1, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->this$0:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-direct {p0}, Lcom/nemustech/tiffany/world/TFModel;-><init>()V

    .line 959
    iput-boolean v1, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mChanged:Z

    .line 960
    const/4 v0, 0x0

    iput v0, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mZ:F

    .line 962
    iput-boolean v1, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mRealized:Z

    .line 832
    iput-object p2, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    .line 833
    return-void
.end method

.method static synthetic access$100(Lcom/nemustech/tiffany/world/TFWorld$TFBackground;)Z
    .locals 1
    .parameter "x0"

    .prologue
    .line 830
    iget-boolean v0, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mRealized:Z

    return v0
.end method


# virtual methods
.method adjustTextureCoordination(Landroid/graphics/Rect;III)V
    .locals 8
    .parameter "rectTexture"
    .parameter "index"
    .parameter "textureWidth"
    .parameter "textureHeight"

    .prologue
    const/4 v7, 0x0

    const/4 v6, 0x0

    .line 900
    iget v3, p1, Landroid/graphics/Rect;->right:I

    int-to-float v3, v3

    int-to-float v4, p3

    div-float v1, v3, v4

    .line 901
    .local v1, newRight:F
    iget v3, p1, Landroid/graphics/Rect;->bottom:I

    int-to-float v3, v3

    int-to-float v4, p4

    div-float v0, v3, v4

    .line 903
    .local v0, newBottom:F
    const-string v3, "TFBackground"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "$$$ texWidth : "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;

    move-result-object v4

    const-string v5, " texHeight : "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 905
    const/16 v3, 0x8

    new-array v2, v3, [F

    aput v6, v2, v7

    const/4 v3, 0x1

    aput v0, v2, v3

    const/4 v3, 0x2

    aput v1, v2, v3

    const/4 v3, 0x3

    aput v0, v2, v3

    const/4 v3, 0x4

    aput v6, v2, v3

    const/4 v3, 0x5

    aput v6, v2, v3

    const/4 v3, 0x6

    aput v1, v2, v3

    const/4 v3, 0x7

    aput v6, v2, v3

    .line 912
    .local v2, t:[F
    array-length v3, v2

    invoke-static {v3}, Lcom/nemustech/tiffany/world/TFUtils;->newFloatBuffer(I)Ljava/nio/FloatBuffer;

    move-result-object v3

    iput-object v3, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mTextureBuffer:Ljava/nio/FloatBuffer;

    .line 913
    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mTextureBuffer:Ljava/nio/FloatBuffer;

    invoke-virtual {v3, v2}, Ljava/nio/FloatBuffer;->put([F)Ljava/nio/FloatBuffer;

    .line 914
    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mTextureBuffer:Ljava/nio/FloatBuffer;

    invoke-virtual {v3, v7}, Ljava/nio/FloatBuffer;->position(I)Ljava/nio/Buffer;

    .line 915
    return-void
.end method

.method public draw(Ljavax/microedition/khronos/opengles/GL10;I)V
    .locals 6
    .parameter "gl"
    .parameter "tickPassed"

    .prologue
    const/16 v5, 0x1406

    const/4 v4, 0x2

    const/4 v1, 0x0

    const/4 v3, 0x0

    const/high16 v2, 0x3f80

    .line 919
    invoke-virtual {p0, p1, p2}, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->applyOpacity(Ljavax/microedition/khronos/opengles/GL10;I)V

    .line 920
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mTextures:Lcom/nemustech/tiffany/world/TFTextures;

    invoke-virtual {v0, p1, v3}, Lcom/nemustech/tiffany/world/TFTextures;->setTextureByIndex(Ljavax/microedition/khronos/opengles/GL10;I)V

    .line 923
    const/16 v0, 0xb44

    invoke-interface {p1, v0}, Ljavax/microedition/khronos/opengles/GL10;->glEnable(I)V

    .line 924
    const/16 v0, 0x405

    invoke-interface {p1, v0}, Ljavax/microedition/khronos/opengles/GL10;->glCullFace(I)V

    .line 925
    const v0, 0x8074

    invoke-interface {p1, v0}, Ljavax/microedition/khronos/opengles/GL10;->glEnableClientState(I)V

    .line 926
    const v0, 0x8078

    invoke-interface {p1, v0}, Ljavax/microedition/khronos/opengles/GL10;->glEnableClientState(I)V

    .line 927
    const v0, 0x8076

    invoke-interface {p1, v0}, Ljavax/microedition/khronos/opengles/GL10;->glDisableClientState(I)V

    .line 928
    const v0, 0x8075

    invoke-interface {p1, v0}, Ljavax/microedition/khronos/opengles/GL10;->glDisableClientState(I)V

    .line 930
    invoke-interface {p1}, Ljavax/microedition/khronos/opengles/GL10;->glPushMatrix()V

    .line 931
    invoke-interface {p1}, Ljavax/microedition/khronos/opengles/GL10;->glLoadIdentity()V

    .line 932
    iget v0, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mZ:F

    invoke-interface {p1, v1, v1, v0}, Ljavax/microedition/khronos/opengles/GL10;->glTranslatef(FFF)V

    .line 933
    iget v0, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mWidth:F

    iget v1, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mHeight:F

    invoke-interface {p1, v0, v1, v2}, Ljavax/microedition/khronos/opengles/GL10;->glScalef(FFF)V

    .line 943
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mVertexBuffer:Ljava/nio/FloatBuffer;

    invoke-interface {p1, v4, v5, v3, v0}, Ljavax/microedition/khronos/opengles/GL10;->glVertexPointer(IIILjava/nio/Buffer;)V

    .line 944
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mTextureBuffer:Ljava/nio/FloatBuffer;

    invoke-interface {p1, v4, v5, v3, v0}, Ljavax/microedition/khronos/opengles/GL10;->glTexCoordPointer(IIILjava/nio/Buffer;)V

    .line 946
    iget v0, p0, Lcom/nemustech/tiffany/world/TFModel;->mOpacity:F

    invoke-interface {p1, v2, v2, v2, v0}, Ljavax/microedition/khronos/opengles/GL10;->glColor4f(FFFF)V

    .line 947
    const/4 v0, 0x5

    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mVertexBuffer:Ljava/nio/FloatBuffer;

    invoke-virtual {v1}, Ljava/nio/FloatBuffer;->capacity()I

    move-result v1

    div-int/lit8 v1, v1, 0x2

    invoke-interface {p1, v0, v3, v1}, Ljavax/microedition/khronos/opengles/GL10;->glDrawArrays(III)V

    .line 953
    const/16 v0, 0x1700

    invoke-interface {p1, v0}, Ljavax/microedition/khronos/opengles/GL10;->glMatrixMode(I)V

    .line 954
    invoke-interface {p1}, Ljavax/microedition/khronos/opengles/GL10;->glPopMatrix()V

    .line 956
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mRealized:Z

    .line 957
    return-void
.end method

.method public setNeedToBeUpdated(Z)V
    .locals 5
    .parameter "bAppearing"

    .prologue
    const-wide/16 v3, 0x0

    const/4 v2, 0x0

    .line 872
    if-eqz p1, :cond_1

    .line 874
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mChanged:Z

    .line 876
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->this$0:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-static {v0}, Lcom/nemustech/tiffany/world/TFWorld;->access$200(Lcom/nemustech/tiffany/world/TFWorld;)J

    move-result-wide v0

    cmp-long v0, v0, v3

    if-lez v0, :cond_0

    .line 877
    invoke-virtual {p0, v2}, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->setOpacity(F)V

    .line 878
    const/high16 v0, 0x3f80

    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->this$0:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-static {v1}, Lcom/nemustech/tiffany/world/TFWorld;->access$200(Lcom/nemustech/tiffany/world/TFWorld;)J

    move-result-wide v1

    invoke-virtual {p0, v0, v1, v2}, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->fade(FJ)V

    .line 887
    :cond_0
    :goto_0
    return-void

    .line 883
    :cond_1
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->this$0:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-static {v0}, Lcom/nemustech/tiffany/world/TFWorld;->access$200(Lcom/nemustech/tiffany/world/TFWorld;)J

    move-result-wide v0

    cmp-long v0, v0, v3

    if-lez v0, :cond_0

    .line 884
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->this$0:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-static {v0}, Lcom/nemustech/tiffany/world/TFWorld;->access$200(Lcom/nemustech/tiffany/world/TFWorld;)J

    move-result-wide v0

    invoke-virtual {p0, v2, v0, v1}, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->fade(FJ)V

    goto :goto_0
.end method

.method public update(Ljavax/microedition/khronos/opengles/GL10;)V
    .locals 1
    .parameter "gl"

    .prologue
    .line 890
    iget-boolean v0, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mChanged:Z

    if-eqz v0, :cond_0

    .line 891
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->updateVertex()V

    .line 892
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->updateLocation()V

    .line 893
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mChanged:Z

    .line 895
    :cond_0
    return-void
.end method

.method protected updateLocation()V
    .locals 9

    .prologue
    const/high16 v8, 0x4000

    .line 849
    iget-object v4, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-object v4, v4, Lcom/nemustech/tiffany/world/TFWorld;->mRenderer:Lcom/nemustech/tiffany/world/TFRenderer;

    iget v3, v4, Lcom/nemustech/tiffany/world/TFRenderer;->mWidth:I

    .line 850
    .local v3, scrWidth:I
    iget-object v4, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-object v4, v4, Lcom/nemustech/tiffany/world/TFWorld;->mRenderer:Lcom/nemustech/tiffany/world/TFRenderer;

    iget v2, v4, Lcom/nemustech/tiffany/world/TFRenderer;->mHeight:I

    .line 851
    .local v2, scrHeight:I
    iget-object v4, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-virtual {v4}, Lcom/nemustech/tiffany/world/TFWorld;->getDepth()F

    move-result v0

    .line 852
    .local v0, depth:F
    const/16 v4, 0x10

    new-array v1, v4, [F

    .line 854
    .local v1, m:[F
    iget-object v4, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-object v4, v4, Lcom/nemustech/tiffany/world/TFWorld;->mRenderer:Lcom/nemustech/tiffany/world/TFRenderer;

    div-int/lit8 v5, v3, 0x2

    int-to-float v5, v5

    div-int/lit8 v6, v2, 0x2

    int-to-float v6, v6

    const/4 v7, 0x0

    invoke-virtual {v4, v5, v6, v1, v7}, Lcom/nemustech/tiffany/world/TFRenderer;->getHitTestLine(FF[FI)V

    .line 855
    iget-object v4, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-object v4, v4, Lcom/nemustech/tiffany/world/TFWorld;->mRenderer:Lcom/nemustech/tiffany/world/TFRenderer;

    int-to-float v5, v3

    int-to-float v6, v2

    const/16 v7, 0x8

    invoke-virtual {v4, v5, v6, v1, v7}, Lcom/nemustech/tiffany/world/TFRenderer;->getHitTestLine(FF[FI)V

    .line 866
    const/4 v4, 0x6

    aget v4, v1, v4

    const/high16 v5, 0x4780

    div-float v5, v0, v5

    const/high16 v6, 0x41a0

    mul-float/2addr v5, v6

    add-float/2addr v4, v5

    iput v4, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mZ:F

    .line 867
    const/16 v4, 0xc

    aget v4, v1, v4

    const/4 v5, 0x4

    aget v5, v1, v5

    sub-float/2addr v4, v5

    mul-float/2addr v4, v8

    iput v4, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mWidth:F

    .line 868
    const/16 v4, 0xd

    aget v4, v1, v4

    const/4 v5, 0x5

    aget v5, v1, v5

    sub-float/2addr v4, v5

    neg-float v4, v4

    mul-float/2addr v4, v8

    iput v4, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mHeight:F

    .line 869
    return-void
.end method

.method protected updateVertex()V
    .locals 3

    .prologue
    .line 836
    const/16 v1, 0x8

    new-array v0, v1, [F

    fill-array-data v0, :array_0

    .line 843
    .local v0, v:[F
    array-length v1, v0

    invoke-static {v1}, Lcom/nemustech/tiffany/world/TFUtils;->newFloatBuffer(I)Ljava/nio/FloatBuffer;

    move-result-object v1

    iput-object v1, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mVertexBuffer:Ljava/nio/FloatBuffer;

    .line 844
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mVertexBuffer:Ljava/nio/FloatBuffer;

    invoke-virtual {v1, v0}, Ljava/nio/FloatBuffer;->put([F)Ljava/nio/FloatBuffer;

    .line 845
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->mVertexBuffer:Ljava/nio/FloatBuffer;

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Ljava/nio/FloatBuffer;->position(I)Ljava/nio/Buffer;

    .line 846
    return-void

    .line 836
    :array_0
    .array-data 0x4
        0x0t 0x0t 0x0t 0xbft
        0x0t 0x0t 0x0t 0xbft
        0x0t 0x0t 0x0t 0x3ft
        0x0t 0x0t 0x0t 0xbft
        0x0t 0x0t 0x0t 0xbft
        0x0t 0x0t 0x0t 0x3ft
        0x0t 0x0t 0x0t 0x3ft
        0x0t 0x0t 0x0t 0x3ft
    .end array-data
.end method
